﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
    CodeBehind="ProjectMaintain.aspx.cs" Inherits="PMS.Web.ProjectMaintain" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <link rel="stylesheet" href="tipswindown/tipswindown.css" type="text/css" media="all" />
    <script type="text/javascript" src="tipswindown/tipswindown.js"></script>
    <script type="text/javascript">
        function GetList(roleID) {
            $("#MainContent_hid_parentID").val(roleID);
            $("#MainContent_btn_Search").click();
        }

        function closeWin() {
            $("#windown-close").click();
            $("#MainContent_btn_Search").click();
        }

        function CloseContentDiv() {
            $(".contentDiv").hide();
            $("#fullscreem").hide();
        }

        //定位到当前屏幕中间
        function PitchDIV(pop) {
            var left_w = ($(window).width() - 550) / 2;
            var top_w = $("html").scrollTop() + 10;
            pop.css({ top: top_w, left: left_w });
            $("#fullscreem").css("height", $(window).height());
            $("#fullscreem").show();
        }

        function expotReport() {
            PitchDIV($(".contentDiv"));
            $(".contentDiv").show();
        }

        //编辑添加项目
        function editProject(id) {
            var roleID = $("#hid_RoleID").val();
            var title = "新建项目";
            if (id != 0) {
                title = "编辑项目";
            }
            else {
                var isCreate = $("#MainContent_hid_IsCreate").val();
                if (isCreate == "0")
                    return;
            }
            tipsWindown(title, "iframe:AddProject.aspx?roleID=" + roleID + "&id=" + id, "700", "370", "true", "", "true", "leotheme");
        }

        //删除项目
        function deleteProject(id) {
            if (confirm('确定删除?')) {
                $.post("ProjectMaintian.ashx", { action: "DeleteProject", projectID: id }, function (data) {
                    if (data == "0") {
                        Search();
                    }
                    else {
                        alert("删除失败");
                    }
                });
            }
        }

        //详细
        function desProject(id) {
            tipsWindown("项目详细", "iframe:AddProject.aspx?id=" + id + "&t=1", "700", "350", "true", "", "true", "leotheme");
        }
        //项目进展
        function desProjectEvelve(id) {
            tipsWindown("项目进展", "iframe:Evelve.aspx?projectID=" + id, "900", "500", "true", "", "true", "leotheme");
        }

        //维护保养
        function desProjectMaintain(id) {
            tipsWindown("维护保养", "iframe:Maintain.aspx?projectID=" + id, "750", "480", "true", "", "true", "leotheme");
        }

        //维修更换
        function desProjectRenewal(id) {
            tipsWindown("维修更换", "iframe:Renewal.aspx?projectID=" + id, "900", "480", "true", "", "true", "leotheme");
        }

        //工程项目财务
        function desProjectState(id) {
            tipsWindown("工程项目财务", "iframe:FinanceState.aspx?projectID=" + id, "900", "480", "true", "", "true", "leotheme");
        }

        //维修项目财务
        function desFinanceRenewal(id) {
            tipsWindown("维修项目财务", "iframe:FinanceRenewal.aspx?projectID=" + id, "900", "480", "true", "", "true", "leotheme");
        }
        //维保项目财务
        function desFinanceMaintainace(id) {
            tipsWindown("维保项目财务", "iframe:FinanceMaintainace.aspx?projectID=" + id, "1024", "480", "true", "", "true", "leotheme");
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div id="fullscreem" style="display: none; background-color: #F1F1F1; filter: alpha(opacity=50);
        opacity: 0.5; width: 100%; height: auto; position: absolute; top: 0px; left: 0px;
        z-index: 5;">
    </div>
    <div class="login_panel master_introduce contentDiv" style="display: none;">
        <div class="panel_title">
            <div class="txt_left" style="float: left;">
                &nbsp;&nbsp;报表导出</div>
            <a href="javascript:void(0);" class="panel_close" onclick="CloseContentDiv();">close</a></div>
        <div class="panel_content">
            <div class="info_main" id="teachInfo">
                <div style="margin: auto; width: 250px;">
                    <div style="margin: auto 0px auto 5px; float: left;">
                        <asp:Button ID="btn_ProjectReport" runat="server" Text="项目报表" CssClass="BlueButton_Min"
                            OnClick="btn_ProjectReport_Click" />
                    </div>
                    <div style="margin: auto 5px auto 5px; float: left;">
                        <asp:Button ID="btn_ReportList" runat="server" Text="清单报表" CssClass="BlueButton_Min"
                            OnClick="btn_ReportList_Click" />
                    </div>
                    <div style="margin: auto 5px auto 0px; float: none;">
                        <asp:Button ID="btn_Finance" runat="server" Text="财务报表" CssClass="BlueButton_Min"
                            OnClick="btn_Finance_Click" />
                    </div>
                </div>
            </div>
        </div>
        <div class="panel_footer" id="thisTeachCourse">
        </div>
    </div>
    <asp:HiddenField ID="hid_parentID" runat="server" Value="0" />
    <asp:HiddenField ID="hid_userID" runat="server" Value="0" />
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <Triggers>
            <asp:PostBackTrigger ControlID="btn_ExpotReport" />
        </Triggers>
        <ContentTemplate>
            <asp:HiddenField ID="hid_IsCreate" runat="server" Value="0" />
            <table width="100%">
                <tr style="padding-top: 2px">
                    <td align="right" style="padding-right: 4px;">
                        <asp:Label ID="Label1" runat="server" Text="项目类型"></asp:Label>
                    </td>
                    <td>
                        <asp:DropDownList ID="ddl_ProjectType" runat="server" OnSelectedIndexChanged="ddl_ProjectType_SelectedIndexChanged"
                            AutoPostBack="True">
                            <asp:ListItem>工程项目</asp:ListItem>
                            <asp:ListItem>维保项目</asp:ListItem>
                            <asp:ListItem>维修项目</asp:ListItem>
                        </asp:DropDownList>
                    </td>
                    <td align="right" style="padding-right: 4px;">
                        <asp:Label ID="Label2" runat="server" Text="工程编号"></asp:Label>
                    </td>
                    <td>
                        <asp:TextBox ID="txt_ProjectID" runat="server" MaxLength="50"></asp:TextBox>
                    </td>
                    <td align="right" style="padding-right: 4px">
                        <asp:Label ID="CalendarFrom" runat="server" Text="From"></asp:Label>
                    </td>
                    <td>
                        <asp:TextBox ID="txt_FromDate" runat="server" class="Wdate" onfocus="WdatePicker()"></asp:TextBox>
                    </td>
                    <td align="right" style="padding-right: 4px">
                        <asp:Label ID="CalendarTo" runat="server" Text="To"></asp:Label>
                    </td>
                    <td>
                        <asp:TextBox ID="txt_ToDate" runat="server" class="Wdate" onfocus="WdatePicker()"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td colspan="8">
                        <img src="image/mainpage_line.jpg" />
                    </td>
                </tr>
                <tr>
                    <td align="left" style="height: 40px">
                        <asp:Button ID="btn_Search" runat="server" Text="查询" class="BlueButton_Min" OnClick="btn_Search_Click" />
                    </td>
                    <td>
                        <asp:Button ID="btn_Add" runat="server" Text="添加" Visible="false" class="BlueButton_Min"
                            OnClientClick="editProject(0);return
    false;" />
                    </td>
                    <td colspan="6">
                        <asp:Button ID="btn_ExpotReport" runat="server" Text="导出" class="BlueButton_Min"
                            OnClick="btn_ExpotReport_Click" />
                    </td>
                </tr>
            </table>
            <img src="image/mainpage_line.jpg" />
            <asp:GridView ID="gv_ProjectList" runat="server" AutoGenerateColumns="False" OnRowDataBound="gv_ProjectList_RowDataBound"
                HeaderStyle-CssClass="GridHeader" HeaderStyle-Height="23px" Width="100%" ShowHeaderWhenEmpty="True"
                CssClass="GridTable" DataKeyNames="id" EmptyDataText="没有数据" EmptyDataRowStyle-CssClass="GridTableTDCenter">
                <Columns>
                    <asp:BoundField DataField="projectID" HeaderText="工程编号" HeaderStyle-CssClass="GridHeader"
                        ItemStyle-CssClass="GridTableTDCenter">
                        <HeaderStyle Width="8%" />
                        <ItemStyle Width="8%" />
                    </asp:BoundField>
                    <asp:BoundField DataField="projectName" HeaderText="项目名称" HeaderStyle-CssClass="GridHeader"
                        ItemStyle-CssClass="GridTableTD">
                        <HeaderStyle Width="10%" />
                        <ItemStyle Width="10%" />
                    </asp:BoundField>
                    <asp:BoundField DataField="startDate" HeaderText="开工日期" DataFormatString="{0:yyyy-MM-dd}"
                        HeaderStyle-CssClass="GridHeader" ItemStyle-CssClass="GridTableTDCenter">
                        <HeaderStyle Width="10%" />
                        <ItemStyle Width="10%" />
                    </asp:BoundField>
                    <asp:BoundField DataField="endDate" HeaderText="完工日期" DataFormatString="{0:yyyy-MM-dd}"
                        HeaderStyle-CssClass="GridHeader" ItemStyle-CssClass="GridTableTDCenter">
                        <HeaderStyle Width="10%" />
                        <ItemStyle Width="10%" />
                    </asp:BoundField>
                    <asp:TemplateField HeaderText="详细" ShowHeader="False">
                        <ItemTemplate>
                            <asp:ImageButton ID="imgbtn_Detail" runat="server" CausesValidation="False" ImageUrl="~/image/Edit.gif"
                                Text="详细" />
                        </ItemTemplate>
                        <HeaderStyle CssClass="GridHeader" Width="4%" />
                        <ItemStyle CssClass="GridTableTDCenter" Width="4%" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="编辑" ShowHeader="False" Visible="false">
                        <ItemTemplate>
                            <asp:ImageButton ID="imgbtn_Edit" runat="server" CausesValidation="False" ImageUrl="~/image/Edit.gif"
                                Text="编辑" />
                        </ItemTemplate>
                        <HeaderStyle CssClass="GridHeader" Width="4%" />
                        <ItemStyle CssClass="GridTableTDCenter" Width="4%" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="删除" ShowHeader="False" Visible="false">
                        <ItemTemplate>
                            <asp:ImageButton ID="imabtn_Delete" runat="server" CausesValidation="False" ImageUrl="~/image/Delete.gif"
                                Text="删除" />
                        </ItemTemplate>
                        <HeaderStyle CssClass="GridHeader" Width="4%" />
                        <ItemStyle CssClass="GridTableTDCenter" Width="4%" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="项目进展" ShowHeader="False" Visible="false">
                        <ItemTemplate>
                            <asp:ImageButton ID="imgbtn_Evelve" runat="server" CausesValidation="False" ImageUrl="~/image/Edit.gif"
                                Text="项目进展" />
                        </ItemTemplate>
                        <HeaderStyle CssClass="GridHeader" Width="4%" />
                        <ItemStyle CssClass="GridTableTDCenter" Width="4%" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="维修更换" ShowHeader="False" Visible="false">
                        <ItemTemplate>
                            <asp:ImageButton ID="imgbtn_Renewal" runat="server" CausesValidation="False" ImageUrl="~/image/Edit.gif"
                                Text="维修更换" />
                        </ItemTemplate>
                        <HeaderStyle CssClass="GridHeader" Width="4%" />
                        <ItemStyle CssClass="GridTableTD" Width="4%" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="维护保养" ShowHeader="False" Visible="false">
                        <ItemTemplate>
                            <asp:ImageButton ID="imgbtn_Maintain" runat="server" CausesValidation="False" ImageUrl="~/image/Edit.gif"
                                Text="维护保养" />
                        </ItemTemplate>
                        <HeaderStyle CssClass="GridHeader" Width="4%" />
                        <ItemStyle CssClass="GridTableTDCenter" Width="4%" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="财务状态" ShowHeader="False" Visible="false">
                        <ItemTemplate>
                            <asp:ImageButton ID="imgbtn_Finance" runat="server" CausesValidation="False" ImageUrl="~/image/Edit.gif"
                                Text="财务状态" />
                        </ItemTemplate>
                        <HeaderStyle CssClass="GridHeader" Width="4%" />
                        <ItemStyle CssClass="GridTableTDCenter" Width="4%" />
                    </asp:TemplateField>
                </Columns>
            </asp:GridView>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
